#include "protection.h"

Protection::Protection()
{
    help.load(":/tpw/help.png");
    helprec.setWidth(50);
    helprec.setHeight(50);
    helprec.moveTo(helpX,helpY);

    cover.load(":/tpw/cov.png");
    coverrec.setWidth(102);
    coverrec.setHeight(102);
    coverrec.moveTo(coverX,coverY);
}

void Protection::updatehelp()
{
    if(helpfree)
    {
        return;
    }
    helpY+=15;
    helprec.moveTo(helpX,helpY);
    if(helpY>=1050)
        helpfree=true;
    return;
}

void Protection::updatecover()
{
    if(use==false)
    {
        return;
    }
    time++;
    coverrec.moveTo(coverX,coverY);
    if(time>=100)
    {
        time=0;
        use=false;
    }
    return;
}
